<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>show</title>
    <link rel="stylesheet" href="../css/bootstrap.css">
    <script src="../js/jquery-3.2.1.js"></script>
</head>
<body>

<h1>查看博客</h1>

<div class="container">

    <div class="collapse navbar-collapse" id="my-navbar-collapse">

        <ul class="nav navbar-nav navbar-right">
            <li class="nav navbar-nav navbar-right">
                <a href="/home" ><b style="color: black">返回主页</b></a>
            </li>
        </ul>

    </div>


    <h3 id="title"></h3>
    <hr>
    <p id="content"></p>


    <script>

        var url = window.location.search;
        var id =url.substring(url.lastIndexOf('=')+1, url.length);
        $.ajax({

        url:"/showdata",
        type:"get",
        data:{
                bid:id
            },
        success:function (result) {

            alert('aaa');

                $("#title").text(result.title)
                $("#content").text(result.content)
            }
        })




    </script>

</div>
</body>
</html>